// 父子传值

new Vue({
	el: '#app',
	components: {
		alert: {
			template: `
				<div>
					<button @click='alertMessage()'>弹出信息</button>
					<p>{{message}}</p>
				</div>
			`,
			props: ['msg'],
			data: function() {
				return {
					message: '',
				}
			},
			methods: {
				alertMessage: function () {
					alert(this.msg);
					this.message = this.msg;
				}
			}
		}
	}
})